//员工库
import axios, {ResponseData} from 'yuxin-base/src/utils/axios'

//添加员工

export const addEmployee = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise_employee/add_enter_prise_employee',
		data,
		method: 'POST'
	})
}

//查询企业的相关信息
export const enterpriseInformationFun = (id: string): Promise<ResponseData> => {
	return axios.request({
		url: `/customer/enter_prise/get_enter_prise/${id}`,
		method: 'GET'
	})
}

// 员工列表
export const employeeList = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise_employee/get_employee_list',
		data,
		method: 'POST'
	})
}

// 员工详情
export const staffDetails = (id: string): Promise<ResponseData> => {
	return axios.request({
		url: `/customer/enter_prise_employee/get_enter_prise_employee_details/${id}`,
		method: 'GET'
	})
}

//重新编辑
export const updateStaff = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise_employee/update_enter_prise_employee',
		data,
		method: 'POST'
	})
}

//员工个人入住
export const staffCheckIn = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise_employee/charter_check_in_house',
		data,
		method: 'POST'
	})
}

//导出
export const staffExport = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise_employee/export_employee',
		data: data,
		method: 'post',
		responseType: 'blob'
	})
}

// 员工库统计
export const staffPoolCount = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise_employee/get_employee_count',
		data,
		method: 'POST'
	})
}

// 查询
export const noCheckIn = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise_employee/get_checkin_houseroom_list',
		data,
		method: 'POST'
	})
}
// 批量入住
export const batchCheckInHouse = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise_employee/batch_check_in_house',
		data,
		method: 'POST'
	})
}

// 一下是导入的方法 接口地址需要跟换
/**
 * 导入资产
 * @param data
 */
export const energyImport = 'house/storage/house_config/read_excel'

/**
 * 生成账单
 * @param data
 */
export const generateFinance = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/finance/finance_enery/generate_finance',
		data,
		method: 'POST'
	})
}

/**
 * 重置
 * @param data
 */
export const energyReset = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/finance/finance_enery/reset',
		data,
		method: 'POST'
	})
}

// 获取仓库列表
export const getStorehouse = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/house/ware_house/list',
		data,
		method: 'POST'
	})
}

//保存导入员工
export const saveEmployee = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise_employee_import/write',
		data,
		method: 'POST'
	})
}

//下载模板
export const downLoadAssets = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/house/storage/house_config/export_excel',
		data,
		method: 'post',
		responseType: 'blob'
	})
}

//获取导入记录
export const getExportDetails = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/house/import_config_Record/pages',
		data,
		method: 'POST'
	})
}

// 导入明细页面
export const importWarehouseDetails = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/house/import_config_Record/item/pages',
		data,
		method: 'POST'
	})
}

//获取入住记录
export const checkInRecordsF = (data: any): Promise<ResponseData> => {
	return axios.request({
		url: '/contract/enter_contract/get_enter_contract_check_list',
		data,
		method: 'POST'
	})
}

//下载模板
export const employeeTemplate = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise_employee/export/employee_template',
		data,
		method: 'post',
		responseType: 'blob'
	})
}

//批量导入员工
export const enterPriseEmployeeImport = 'customer/enter_prise_employee_import/import'

//查询导入数据不分页
export const recordList = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise_employee_import/record/list',
		data,
		method: 'post'
	})
}
//查询员工导入记录
export const importRecords = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise_employee_import/page',
		data,
		method: 'post'
	})
}
//
//修改员工上传状态
export const updateEmployment = (data: object): Promise<ResponseData> => {
	return axios.request({
		url: '/customer/enter_prise_employee_import/record/update',
		data,
		method: 'post'
	})
}

